package com.lujieni.dao;

import com.lujieni.mybatis.basedao.BaseDao;
import com.lujieni.domain.po.PersonPO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PersonDao extends BaseDao<PersonPO> {

    List<PersonPO> queryPersonByName(@Param("name") String name, RowBounds rowBounds);
    Integer queryPersonByNameCount(@Param("name") String name);

    PersonPO queryAll();

    List<PersonPO> useFindInSet(@Param("name") String name);

    /**
     * 查询年龄大于age的人
     * @param age
     * @return
     */
    List<PersonPO> queryAgeOver(@Param("age") Integer age);

    /**
     * 根据id查询年龄是否大于30 0:<=30 1:>30
     * @return
     */
    Integer queryAgeIfOver30ById(@Param("id")Integer id);

}
